<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ManeuverActionTest</title>

<link rel="stylesheet"
	href="http://code.jquery.com/qunit/qunit-1.15.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.15.0.js"></script>

<script src="../../main/js/util/JavaScriptAugments.js"></script>
<script src="../../main/js/util/Logger.js"></script>
<script src="../../main/js/util/ArrayUtilities.js"></script>
<script src="../../main/js/util/InputValidator.js"></script>

<script src="../../main/js/Phase.js"></script>
<script src="../../main/js/Team.js"></script>
<script src="../../main/js/Path.js"></script>
<script src="../../main/js/Maneuver.js"></script>
<script src="../../main/js/ManeuverAction.js"></script>
<script src="../../main/js/ShipAction.js"></script>
<script src="../../main/js/Ship.js"></script>
<script src="../../main/js/RangeRuler.js"></script>
<script src="../../main/js/Weapon.js"></script>
<script src="../../main/js/Pilot.js"></script>
<script src="../../main/js/DamageCard.js"></script>
<script src="../../main/js/Position.js"></script>
<script src="../../main/js/UpgradeCard.js"></script>
<script src="../../main/js/Token.js"></script>
<script src="../../main/js/SquadBuilder.js"></script>
<script src="../../main/js/Environment.js"></script>
<script src="../../main/js/SimpleAgent.js"></script>

<script src="../../main/js/ui/ImageUtilities.js"></script>
<script src="../../main/js/ui/HumanAgent.js"></script>

<script>
    var LOGGER = new Logger();

    QUnit.test("ManeuverAction.doIt() Straight1Easy", function(assert)
    {
        // Setup.
        Token.resetNextId();
        var environment = Environment.createCoreSetEnvironment();
        var maneuver = Maneuver.STRAIGHT_1_EASY;
        var fromPosition = new Position(458, 895, -90);
        var token = environment.getTokenAt(fromPosition);
        assert.ok(token);
        environment.removeToken(fromPosition);
        fromPosition = new Position(fromPosition.getX(), fromPosition.getY(),
                -30);
        environment.placeToken(fromPosition, token);

        var shipBase = token.getShipBase();
        var maneuverAction = new ManeuverAction(environment, maneuver,
                fromPosition, shipBase);

        // Run.
        maneuverAction.doIt();

        // Verify.
        var toPosition = environment.getPositionFor(token);
        assert.equal(toPosition.getX(), fromPosition.getX() + 69);
        assert.equal(toPosition.getY(), fromPosition.getY() - 40);
        assert.equal(toPosition.getHeading(), 330);
    });
</script>
</head>
<body>
	<div id="qunit"></div>
</body>
</html>
